﻿using System;
using System.IO;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using PeachLite.Entity;

namespace PeachLite.Admin.X
{
    /// <summary>
    /// FileManagerDelete 的摘要说明
    /// </summary>
    public class FileManagerDelete : AjaxBase 
    {
        protected override SysMessage Do(int code)
        {
            string path = Context.Request["path"];
            SysMessage m = new SysMessage();

            try
            {
                File.Delete(Context.Server.MapPath(path));
                m.Success = true;
            }
            catch (Exception ex)
            {
                m.Success = false;
                m.Message = "删除失败!详细信息:" + ex.Message;
            }
            
            return m;
        }
    }
}